package cn.psh.service.impl;

import cn.psh.domain.Product;
import cn.psh.mapper.ProductMapper;
import cn.psh.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public Product add(Product product) {
        productMapper.save(product);
        return product;
    }

    @Override
    public Product loadByName(String name) {
        return productMapper.loadByName(name);
    }
}
